package main

import "fmt"

type Student struct {
	Name  string
	Age   int
	Score int
}

//小学生
type Pupil struct {
	Student
}

//大学生
type Graduate struct {
	Student
}

func (stu *Student) ShowInfo() {
	fmt.Printf("学生名字=%v  年龄=%v  成绩=%v", stu.Name, stu.Age, stu.Score)
}

func (stu *Student) SetSocre(socre int) {
	stu.Score = socre
}

func (p *Pupil) testing() {
	fmt.Println("小学生考试ing")
}

func (p *Graduate) testing() {
	fmt.Println("大学生考试ing")
}

func main() {
	var pupil = &Pupil{}
	pupil.Student.Name = "tom"
	pupil.Student.Age = 8
	pupil.Score = 88
	pupil.ShowInfo()
	pupil.SetSocre(90)
	pupil.ShowInfo()
}
